﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Obra.PowerShell.SmugMug;

namespace Obra.Test.SmugMug.PowerShell
{
    [TestFixture]
    public class PathSegmentsTester
    {
        [Test]
        public void Test()
        {
            PathSegments segments1 = new PathSegments(@"smugmug:\");
            Assert.AreEqual(@"smugmug:\", segments1.DriveName);
            Assert.IsEmpty(segments1.AlbumName);
            Assert.IsEmpty(segments1.ImageName);
            Assert.AreEqual(1, segments1.Count);

            PathSegments segments2 = new PathSegments(@"smugmug:\album");
            Assert.AreEqual(@"smugmug:\", segments2.DriveName);
            Assert.AreEqual("album", segments2.AlbumName);
            Assert.IsEmpty(segments2.ImageName);
            Assert.AreEqual(@"smugmug:\album", segments2.AlbumPath);
            Assert.AreEqual(2, segments2.Count);

            PathSegments segments3 = new PathSegments(@"smugmug:\album\image.jpg");
            Assert.AreEqual(@"smugmug:\", segments3.DriveName);
            Assert.AreEqual("album", segments3.AlbumName);
            Assert.AreEqual("image.jpg", segments3.ImageName);
            Assert.AreEqual(@"smugmug:\album", segments3.AlbumPath);
            Assert.AreEqual(@"smugmug:\album\image.jpg", segments3.ImagePath);
            Assert.AreEqual(3, segments3.Count);
        }
    }
}
